<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
  <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.min.css" />
  <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.min.css">
  <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
  <link rel="stylesheet" href="./css/common.css" />
</head>

<body class="pl-180">
  <div class="aside bg-color">
    <div class="user">
      <h1>乐淘商城</h1>
      <img src="./images/default.png" alt="">
      <h3>超级管理员</h3>
    </div>
    <ul class="manage">
      <li><a href="user.html"><span class="glyphicon glyphicon-user"></span>用户管理</a></li>
      <li class="category">
        <a href="#"><span class="glyphicon glyphicon-user"></span>分类管理</a>
        <ul class="two">
          <li><a href="one.html">一级菜单</a></li>
          <li class="menu-active"><a href="two.html">二级菜单</a></li>
        </ul>
      </li>
      <li><a href="product.html"><span class="glyphicon glyphicon-user"></span>商品管理</a></li>
    </ul>
  </div>
  <div class="main">
    <div class="top pl-180">
      <i class="glyphicon glyphicon-th-list pull-left icon-m8 icon-f30 i-toggle"></i>
      <i class="glyphicon glyphicon-th-list pull-right icon-m8 icon-f30 i-return" data-toggle="modal"
        data-target="#exit-modal"></i>
    </div>

    <div class="content mt50 p10">
      <ol class="breadcrumb">
        <li class="home"><a href="#">后台管理</a></li>
        <li class="active">分类管理</li>
        <li class="active">二级菜单</li>
      </ol>

      <!-- 添加分类按钮 -->
      <button class="btn btn-default addCategory">添加分类</button>

      <!-- 一级分类表格 -->
      <table class="table table-hover table-bordered text-center table-striped">
        <thead>
          <tr>
            <th>序号</th>
            <th>一级分类名</th>
            <th>一级分类名</th>
            <th>二级分类LOGO</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>1</td>
            <td>一级分类名</td>
            <td>二级分类名称</td>
            <td>二级分类LOGO</td>
          </tr>
        </tbody>
      </table>

      <!-- 分页容器 -->
      <ul id="paginator"></ul>
    </div>

  </div>

  <!-- 添加分类模态框 -->
  <div class="modal fade" tabindex="-1" role="dialog" id="addModal">
    <div class="modal-dialog modal-sm" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
              aria-hidden="true">&times;</span></button>
          <h4 class="modal-title">添加分类</h4>
        </div>
        <div class="modal-body">
          <form id="form-validator">
            <div class="form-group">
              <div class="dropdown">
                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
                  <span class="first-menu-title">请选择一级分类</span>
                  <span class="caret"></span>
                </button>
                <ul class="dropdown-menu render-first-level-menu">
                </ul>
              </div>
              <input type="hidden" name="categoryId" id="saveId">
            </div>
            <div class="form-group">
              <input type="text" class="form-control" id="category" name="brandName" placeholder="请输入二级分类">
            </div>
            <div class="form-group">
              <!-- label与表单关联 -->
              <label for="fileupload" class="btn btn-default">上传图片</label>
              <!-- name指定图片上传时的name属性 -->
              <!-- data-url指定图片上传时的接口地址 -->
              <!-- 这个插件 只要图片一选中，就会监听到，然后自动上传到服务器 -->
              <input id="fileupload" type="file" name="pic1" data-url="/category/addSecondCategoryPic" style="display: none;">
            </div>
            <div class="form-group">
              <img src="./images/none.png" alt="" style="width: 100px;" id="brandImg">
              <input type="hidden" name="brandLogo" id="brandImgSrc">
            </div>
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
          <button type="submit" class="btn btn-primary" form="form-validator">添加</button>
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->

  <!-- 退出模态框 -->
  <div class="modal fade model-open" id="exit-modal" tabindex="-1">
    <div class="modal-dialog modal-sm">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
              aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="myModalLabel">温馨提示</h4>
        </div>
        <div class="modal-body">
          <p style="margin-bottom: 0;" class="text-warning"><i class="glyphicon glyphicon-info-sign"></i> 确定要退出吗？</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          <button type="button" class="btn btn-primary btn-exit">确定</button>
        </div>
      </div>
    </div>
  </div>

  <!-- 模板渲染一级分类 -->
  <script type="text/html" id="tmp">
    {{each rows v i}}
      <li data-id="{{v.id}}" class="first-menu-list"><a href="#">{{v.categoryName}}</a></li>
    {{/each}}
  </script>
  <!-- 模板渲染二级分类 -->
  <script type="text/html" id="tmp2">
    {{each rows v i}}
    <tr> 
      <td>{{i+1+size*(page-1)}}</td>
      <td>{{v.categoryName}}</td>
      <td>{{v.brandName}}</td>
      <td><img src="{{v.brandLogo}}" height="60"></td>
    </tr>
    {{/each}}
  </script>

  <script src="./lib/artTemplate/template-web.js"></script>
  <script src="./lib/jquery/jquery.min.js"></script>
  <script src="./lib/bootstrap/js/bootstrap.min.js"></script>
  <script src="./lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
  <script src="./lib/bootstrap-paginator/bootstrap-paginator.min.js"></script>
  <script src="./lib/nprogress/nprogress.js"></script>
  <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
  <script src="./lib/jquery-fileupload/jquery.iframe-transport.js"></script>
  <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
  <script src="./js/common.js"></script>
  <script src="./js/two.js"></script>
</body>

</html>